﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace 基于WPF的电缆采样数据分析系统.Views.TDRWork
{
    /// <summary>
    /// MenuPageUC.xaml 的交互逻辑
    /// </summary>
    public partial class MenuPageUC : UserControl
    {
        public MenuPageUC()
        {
            InitializeComponent();

            // 默认显示日志
            InitShowPage();
        }

        /// <summary>
        /// 默认显示日志界面
        /// </summary>
        private void InitShowPage()
        {
            LogControl.Visibility = Visibility.Visible;
            ChannelControl.Visibility = Visibility.Collapsed;
            CursorControl.Visibility = Visibility.Collapsed;

            // 选中标签
            SelectedLogBtnStyle();
        }

        /// <summary>
        /// 日志按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LogBtn_Click(object sender, RoutedEventArgs e)
        {
            LogControl.Visibility = Visibility.Visible;
            ChannelControl.Visibility = Visibility.Collapsed;
            CursorControl.Visibility = Visibility.Collapsed;

            SelectedLogBtnStyle();
        }

        /// <summary>
        /// 通道按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ChannelBtn_Click(object sender, RoutedEventArgs e)
        {
            LogControl.Visibility = Visibility.Collapsed;
            ChannelControl.Visibility = Visibility.Visible;
            CursorControl.Visibility = Visibility.Collapsed;

            SelectedChannelBtnStyle();
        }

        /// <summary>
        /// 光标按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CursorBtn_Click(object sender, RoutedEventArgs e)
        {
            LogControl.Visibility = Visibility.Collapsed;
            ChannelControl.Visibility = Visibility.Collapsed;
            CursorControl.Visibility = Visibility.Visible;

            SelectedCursorBtnStyle();
        }

        /// <summary>
        /// 日志按钮样式
        /// </summary>
        private void SelectedLogBtnStyle()
        {
            LogBtn.BorderThickness = new Thickness(0, 4, 0, 0);
            ChannelBtn.BorderThickness = new Thickness(0);
            //CursorBtn.BorderThickness = new Thickness(0);
        }

        /// <summary>
        /// 通道按钮样式
        /// </summary>
        private void SelectedChannelBtnStyle()
        {
            LogBtn.BorderThickness = new Thickness(0);
            ChannelBtn.BorderThickness = new Thickness(0, 4, 0, 0);
            //CursorBtn.BorderThickness = new Thickness(0);
        }

        /// <summary>
        /// 光标按钮样式
        /// </summary>
        private void SelectedCursorBtnStyle()
        {
            LogBtn.BorderThickness = new Thickness(0);
            ChannelBtn.BorderThickness = new Thickness(0);
            //CursorBtn.BorderThickness = new Thickness(0, 4, 0, 0);
        }
    }
}
